<template>
  <div class="container">
    <!-- 金银币明细 -->
    <div class="nav" :class="status_top == 44?'nav1':''">
      <div class="backBtn" @click="backBtn">
        <img v-if="imgUrl" :src="imgUrl+'h5_images/mp_images/mp_3.1.6/wallet/ic_back_white%403x.png'" alt class="img" />
      </div>
    </div>
    <div class="top" :class="status_top == 44?'top1':''">
      <div class="top_main">
        <div class="title">提现金额(元)：</div>
        <div class="num">{{amount}}</div>
        <div class="time">提现时间：{{createtime}}</div>
      </div>
    </div>
    <div class="content">
      <div class="item" v-for="(item,index) in inforList" :key="index">
        <div class="timer">{{item.time}}</div>
        <div class="fonts_box">
          <span class="icon"></span>
          <div class="fonts">
            <div class="title">当前排队人数：<span>{{item.hovernumber}}</span>人</div>
            <p>分享人员购买PLUS会员可参与进行插队</p>
            <p>分享一个PLUS会员可以插队100人</p>
          </div>
        </div>
      </div>
    </div>
    <div class="btn" @click="cancelBtn">取消排队</div>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
let modeltimer, timer;
export default {
  data () {
    return {
      imgUrl: "https://img.ameimeika.com/",
      ImgBaseUrl: "https://h5.ameimeika.com/mp_images/",
      status_top:'',
      amount:0,
      createtime:'',
      inforList:[]
    };
  },
  methods: {
    getInfo(){
      common.fly_post(
        "api/v4_6/activity/seelineup",
        {},
        msg => {
          wx.hideLoading();
          let res = msg.data;
          if (res.status_code == 0) {
            this.amount = res.data.amount
            this.createtime = res.data.createtime
            this.inforList = res.data.messagedata
            this.inforList.forEach(item => {
              item.time = new Date(item.time * 1000).Format("hh:mm:ss")
            });
          } else {
            // wx.hideLoading();
            wx.showToast({
              title: res.message,
              icon: "none",
              duration: 2000,
              mask: true
            });
            return false;
          }
        }
      );
    },
    cancelBtn(){
      common.fly_post(
        "api/v4_6/activity/cancelseeline",
        {},
        msg => {
          wx.hideLoading();
          let res = msg.data;
          if (res.status_code == 0) {
            wx.navigateBack({
                url: '/pages/package_mine/my_wallet/main'
            })
          } else {
            // wx.hideLoading();
            wx.showToast({
              title: res.message,
              icon: "none",
              duration: 2000,
              mask: true
            });
            return false;
          }
        }
      );
    }
  },

  onLoad (options) {
    wx.setNavigationBarTitle({
      title: "排队"
    });
    wx.setNavigationBarColor({
      frontColor: "#ffffff", //前景颜色值，包括按钮、标题、状态栏的颜色，仅支持 #ffffff 和 #000000,
      backgroundColor: "#FC799A", //背景颜色值，有效值为十六进制颜色,
      success: res => { }
    });
    let that = this;
    wx.getSystemInfo({
      success: function (res) {
        console.log(res.statusBarHeight);
        that.status_top = res.statusBarHeight;
        //  console.log(that.status_top)
      }
    });
    this.getInfo()
  },

  onShow () {
   
  }
};
</script>

<style scoped lang="less">
.container {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: rgba(248, 248, 248, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  .top {
    width: 100%;
    height: 126px;
    // margin-top: 60px;
    box-sizing: border-box;
    position: relative;
    background: url("https://img.ameimeika.com/h5_images/beauty_share/top_img.png")
      no-repeat;
    background-size: 100% 100%;
    &.top1 {
      padding-top: 98px;
    }
    .top_main {
      width: 345px;
      padding: 25px 0;
      position: absolute;
      top: 12px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(255, 255, 255, 1);
      border-radius: 8px;
      text-align: center;
      .title {
        font-size: 14px;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
        line-height: 20px;
      }
      .num {
        font-size: 27px;
        font-weight: 500;
        color: rgba(255, 128, 158, 1);
        line-height: 38px;
        padding: 3px 0 9px;
      }
      .time {
        font-size: 13px;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        line-height: 18px;
      }
    }
  }
  .nav {
    width: 100%;
    height: 88px;
    padding-top: 20px;
    background: url("https://img.ameimeika.com/h5_images/beauty_share/nav_bj.png")
      no-repeat;
    background-size: 100% 100%;
    box-sizing: border-box;
    &.nav1 {
      padding-top: 44px;
    }
    .backBtn {
      width: 10px;
      height: 16px;
      position: absolute;
      bottom: 0;
      left: 10px;
      padding: 14px 15px 14px 5px;
      .img {
        width: 100%;
        height: 100%;
      }
    }
  }
  .btn {
    width: 345px;
    height: 40px;
    background: rgba(255, 128, 158, 1);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 1);
    line-height: 40px;
    text-align: center;
    margin-bottom: 20px;
  }
  .content {
    box-sizing: border-box;
    flex: 1;
    overflow-y: auto;
    padding: 44px 15px 20px;
    width: 100%;
    .item {
      margin-bottom: 17px;
      .timer {
        font-size: 12px;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        line-height: 17px;
        margin-bottom: 6px;
      }
      .fonts_box {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
        .icon {
          display: block;
          width: 30px;
          height: 24px;
          background: url("https://img.ameimeika.com/h5_images/beauty_share/icon.png")
            no-repeat;
          background-size: 100% 100%;
          margin-right: -5px;
          margin-top: 2px;
        }
        .fonts {
          flex: 1;
          background: url("https://img.ameimeika.com/h5_images/beauty_share/fonts_bj.png")
            no-repeat;
          background-size: 100% 100%;
          padding: 7px 0 8px 36px;
          .title {
            font-size: 12px;
            font-weight: 400;
            color: rgba(51, 51, 51, 1);
            line-height: 17px;
            span {
              color: #ff809e;
            }
          }
          p {
            padding-top: 3px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(102, 102, 102, 1);
            line-height: 17px;
          }
        }
      }
    }
  }
}
</style>

